<?php

namespace Trawind\Basics\Criteria;

use Prettus\Repository\Contracts\CriteriaInterface;
use Prettus\Repository\Contracts\RepositoryInterface;

/**
 * Class StatusExcludeCriteria
 * @package Trawind\Basics\Criteria
 */
class StatusExcludeCriteria implements CriteriaInterface
{


    protected $statusTypeId;


    /**
     * StatusInCriteria constructor.
     * @param  int  $statusTypeId
     */
    public function __construct(int $statusTypeId)
    {
        $this->statusTypeId = $statusTypeId;
    }


    /**
     * Apply criteria in query repository
     *
     * @param  string  $model
     * @param  RepositoryInterface  $repository
     *
     * @return mixed
     */
    public function apply($model, RepositoryInterface $repository)
    {
        return $model->where('status_type_id', '<>', $this->statusTypeId);
    }
}
